package com.manner.groupon.utils;

import javax.servlet.http.HttpServletRequest;

public class IPUtil {

    /**
     * 获取请求IP
     * @param request   请求对象
     * @return
     */
    public static String getIp(HttpServletRequest request) {
        String ipAddress = request.getRemoteAddr();
        if (ipAddress.equals("0:0:0:0:0:0:0:1")) {
            ipAddress = "127.0.0.1";
        }
        return ipAddress;
    }

}
